package com.aiyige.page.login.model.impl;

import android.app.Activity;
import android.text.TextUtils;

import com.aiyige.page.login.view.IDialogView;
import com.aiyige.utils.dialog.LoadingDialog;

/**
 * Created by xiachao on 2017/10/24.
 */

public class DialogImplement implements IDialogView {

    LoadingDialog loadingDialog;

    public DialogImplement(Activity activity) {
        loadingDialog = new LoadingDialog(activity);
    }

    @Override
    public boolean isShowLoading() {
        return loadingDialog.isShowLoading();
    }

    @Override
    public void showLoading(String content) {
        if (!TextUtils.isEmpty(content)) {
            loadingDialog.setLoadText(content);
        }
        loadingDialog.showLoading();
    }

    @Override
    public void hideLoading() {
        loadingDialog.dismiss();
    }

}
